package com.mall.live.controller;

import com.mall.common.response.CommonResponse;
import com.mall.entity.live.TbLiveMessage;
import com.mall.live.service.ILiveFollowerService;
import com.mall.live.service.ILiveMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * 消息互动
 * @author  LiJinYang
 * @email  283006176@qq.com
 * @date 2021/07/30 15:53
 * @version 1.0
 */
@RestController
@RequestMapping("/liveMessage")
public class LiveMessageController {
    @Autowired
    private ILiveMessageService iLiveMessageService;

    /**
     * 直播消息回复
     * @param tbLiveMessage
     * @return
     */
    @PostMapping("/reply")
    public CommonResponse reply(@RequestBody TbLiveMessage tbLiveMessage){
        try{
            iLiveMessageService.reply(tbLiveMessage);
            return new CommonResponse(0,"回复成功");
        }catch (Exception e){
            e.printStackTrace();
            return new CommonResponse(-1,"回复失败");
        }
    }


}
